home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
003
/
today.prg
< prev
next >
Wrap
Text File
|
1984-09-25
|
3KB
|
85 lines
************************************************************
* *
* TODAY.PRG created by John Chidester *
* 5515 N. 7th Street, Suite 5-169 *
* Phoenix, AZ 85014 *
* *
* Requires dBaseII (Ver 2.4) (May work with earlier) *
* *
* This program converts system date to month, day, year *
* format (i.e. "September 24, 1984") from the standard *
* 09/24/84 format. This program may be called from your *
* dBase II program (DO TODAY) or you may 'merge' this *
* program within your program (seems to run faster that *
* way). The end result is a variable called 'today' which *
* stores the current date in the new format. You can then *
* use this new date format on screen or in your printed *
* reports. Looks a lot better and less cryptic!. *
* *
************************************************************
****** If the operator forgot to set the date when booting up
* the first 'IF..ENDIF' will get the date.
IF DATE()='01/01/80'
ERASE
STORE ' ' TO TODAY
@ 10,10 SAY "What is today's date? (MM/DD/YY) " GET TODAY ;
PICTURE '##/##/##'
READ
ELSE
STORE DATE() TO TODAY
ENDIF
****** YOU MAY WANT TO CONVERT THIS SERIES OF 'IF...ENDIF' TO A 'CASE'
* SERIES OF STATEMENTS
IF $(TODAY,1,2)='01'
STORE 'January' to month
ENDIF
IF $(TODAY,1,2)='02'
STORE 'February' TO MONTH
ENDIF
IF $(TODAY,1,2)='03'
STORE 'March' TO MONTH
ENDIF
IF $(TODAY,1,2)='04'
STORE 'April' TO MONTH
ENDIF
IF $(TODAY,1,2)='05'
STORE 'May' TO MONTH
ENDIF
IF $(TODAY,1,2)='06'
STORE 'June' TO MONTH
ENDIF
IF $(TODAY,1,2)='07'
STORE 'July' TO MONTH
ENDIF
IF $(TODAY,1,2)='08'
STORE 'August' TO MONTH
ENDIF
IF $(TODAY,1,2)='09'
STORE 'September' TO MONTH
ENDIF
IF $(TODAY,1,2)='10'
STORE 'October' TO MONTH
ENDIF
IF $(TODAY,1,2)='11'
STORE 'November' TO MONTH
ENDIF
IF $(TODAY,1,2)='12'
STORE 'December' TO MONTH
ENDIF
STORE $(TODAY,4,2) TO DAY
IF $(DAY,1,1)='0'
STORE $(DAY,2,1) TO DAY
ENDIF
STORE $(TODAY,7,2) TO YEAR
STORE '19'+YEAR TO YEAR
STORE MONTH+' '+DAY+', '+YEAR TO TODAY
RELEASE MONTH, DAY, YEAR
****** The next statement stores the date to a MEM file so
* that you can restore it later (after a 'CLEAR').
SAVE TO TODAY.MEM ALL LIKE TODAY
****** If you merge this program in yours, delete the RETURN
RETURN
***************************************************
***************************************************
***************************************************